package com.jack.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.jack.entity.User;

@RestController
public class UserMovieController {

	@Autowired
	private RestTemplate restTemplate;
	
	@GetMapping("/user/{id}")
	public User findOne(@PathVariable("id") Long id){
		User user =restTemplate.getForObject("http://localhost:8081/" + id, User.class);
		return user;
	}
	
	
}
